import request from '/@/utils/request';
import { AxiosRequestConfig } from 'axios';

/*------------------- 制度文档接口-----------------------*/
// 获取制度文档列表接口
export const getSystemDocumentListApi = (params?: object) => {
    return request({
        url: '/SMS/InstitutionalDocumentManagement/Query',
        method: 'get',
        data: params,
    });
}

// 删除制度文档接口
export const deleteSystemDocumentApi = (params: object) => {
    return request({
        url: '/SMS/InstitutionalDocumentManagement/Delete',
        method: 'post',
        data: params,
    });
}

//新增制度文档接口
export const addSystemDocumentApi = (params: object) => {
    return request({
        url: '/SMS/InstitutionalDocumentManagement/Add',
        method: 'post',
        data: params,
    });
}

// 更新制度文档接口
export const updateSystemDocumentApi = (params: object) => {
    return request({
        url: '/SMS/InstitutionalDocumentManagement/Update',
        method: 'post',
        data: params,
    });
}

/*------------------- 友商信息接口-----------------------*/
// 获取供应商产品管理接口

export const getSupplierProductManagementApi = (params?: object) => {
    return request({
        url: '/OMS/ProviderV2/Page',
        method: 'get',
        data: params,
    });
}

// 删除供应商产品管理接口
export const deleteSupplierProductManagementApi = (params: object) => {
    return request({
        url: '/OMS/ProviderV2/Delete',
        method: 'post',
        data: params,
    });
}

//新增供应商产品管理接口
export const addSupplierProductManagementApi = (params: object) => {
    return request({
        url: '/OMS/ProviderV2/Create',
        method: 'post',
        data: params,
    });
}

// 更新供应商产品管理接口
export const updateSupplierProductManagementApi = (params: object) => {
    return request({
        url: '/OMS/ProviderV2/Update',
        method: 'post',
        data: params,
    });
}

// 详情供应商产品管理接口
export const getSupplierProductManagementDetailApi = (params: object) => {
    return request({
        url: '/OMS/ProviderV2/Detail',
        method: 'get',
        data: params,
    });
}

//获取友商国家地区
export const getSupplierCountryRegionApi = (params?: object) => {
    return request({
        url: '/sysDictData/list',
        method: 'get',
        data: params,
    });
}

/*------------------- 友商基本信息接口-----------------------*/
// 获取供应商基本信息接口 全部
export const getSupplierBasicInfoApi = (params?: object) => {
    return request({
        url: '/OMS/Provider/GetList',
        method: 'get',
        data: params,
    });
}

// 获取供应商基本信息接口 分页
export const getSupplierBasicInfoPageApi = (params?: object) => {
    return request({
        url: '/OMS/ProviderProduct/Query',
        method: 'get',
        data: params,
    });
}

// 删除供应商基本信息接口
export const deleteSupplierBasicInfoApi = (params: object) => {
    return request({
        url: '/OMS/ProviderProduct/Delete',
        method: 'post',
        data: params,
    });
}

// 新增供应商基本信息接口
export const addSupplierBasicInfoApi = (params: object) => {
    return request({
        url: '/OMS/ProviderProduct/Create',
        method: 'post',
        data: params,
        multiPartFormData: false,
    }as AxiosRequestConfig);
}

// 修改供应商基本信息接口
export const updateSupplierBasicInfoApi = (params: object) => {
    return request({
        url: '/OMS/ProviderProduct/Update',
        method: 'post',
        data: params,
        multiPartFormData: false,
    }as AxiosRequestConfig);
}
//获取上级友商信息
export const getSupplierBasicInfoApi2 = (params?: object) => {
    return request({
        url: '/OMS/ProviderV2/List',
        method: 'get',
        data: params,
    });
}

/*------------------- 友商附件上传下载-----------------------*/
export const uploadFileApi = (params: object) => {
    return request({
        url: '/OMS/ProviderDocument/Create',
        method: 'post',
        data: params,
        multiPartFormData: true,
    }as AxiosRequestConfig);
}
export const downloadFileApi = (params?: object) => {
    return request({
        url: '/OMS/ProviderDocument/Query',
        method: 'get',
        data: params,
        multiPartFormData: false,
    }as AxiosRequestConfig);
}